﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using CSM.Client;
using ZYSocket.ClientA;

namespace CSMClient
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			if (!SocketManager.client.ConnectionTo("127.0.0.1", 5421)) //连接到服务器
			{
				MessageBox.Show("无法连接服务器"); //无法连接 提示 并关闭
			}
			else
			{
				if (Logon())
				{
					Application.Run(new Form1());
				}
			}
		}

		private static bool Logon()
		{
			UserLoginForm logon = new UserLoginForm();

			logon.ShowDialog(); //显示登入界面

			return logon.Logins;
		}
	}
}
